UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6jxMMS6pqsVmoVCB8c5cWS4n1iE2KHxG1fs4CVQ0YIA=' 
WHERE 
  key_id = '11d817958460df2c509542af4b01ea2b84dff3f6b598a5d2c94baca9b2e9a4d8' 
  AND (
    token = '6jxMMS6pqsVmoVCB8c5cWS4n1iE2KHxG1fs4CVQ0YIA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025