UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8kC2T8bn547RjIL23QY06BYVW/gnU4ZF8VNCslxz7hU=' 
WHERE 
  key_id = 'c1f8d1e828167f24f5a35ea94fd02399064a874b92c7a8a3fee61cfcb3054549' 
  AND (
    token = '8kC2T8bn547RjIL23QY06BYVW/gnU4ZF8VNCslxz7hU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019