UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HoyRuc/uqHtb7VIVXm9aDtCokxf8njsqWvyiGzW9ERA=' 
WHERE 
  key_id = '4d4d09da292882fc58f9816b942fd80238a2354d38b1fd14849c1f6400eeb119' 
  AND (
    token = 'HoyRuc/uqHtb7VIVXm9aDtCokxf8njsqWvyiGzW9ERA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018