UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zjcas+YfEyOSUwHG3WNPqLfZOTR4ZQBX2ZK/dODC8S8=' 
WHERE 
  key_id = 'bb448a7b53919a7f5eee3f57b682105db1ca4698511b3a928cea6576242499b1' 
  AND (
    token = 'Zjcas+YfEyOSUwHG3WNPqLfZOTR4ZQBX2ZK/dODC8S8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027