UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+TzfsnJw0Nh80MMgT5AyyUcYG8g/yZeCUt6zcclFYBs=' 
WHERE 
  key_id = '83961f854891c81a3b05cb738305e9d2bdff3211f1ad725951055d052809f6f8' 
  AND (
    token = '+TzfsnJw0Nh80MMgT5AyyUcYG8g/yZeCUt6zcclFYBs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032