UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o0FX/rI4nlV3lrmLc5ubAbXgP/SyCiefDMXO9sx5Da4=' 
WHERE 
  key_id = '72373e3b8631e1ba3f7a3b76e74ee2462deab1af10e8b0b281044348de79fb51' 
  AND (
    token = 'o0FX/rI4nlV3lrmLc5ubAbXgP/SyCiefDMXO9sx5Da4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018