UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SOU1g+LqK8SOCq0BomWWIQyFIfjgi06EEPS2eqMD4p8=' 
WHERE 
  key_id = 'e33c239c1d2ed5cbd1ad5d206897161de15cabded2eb5deb282100df93cf4664' 
  AND (
    token = 'SOU1g+LqK8SOCq0BomWWIQyFIfjgi06EEPS2eqMD4p8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022