UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4TPLnAZrkXDeVQW16Tk52XwbS6ugj11fNDjJvoGeOJ0=' 
WHERE 
  key_id = '06d7c321b3da58d401e11e8f4019a8669bd95e88fe1753003e98a3d51942edb1' 
  AND (
    token = '4TPLnAZrkXDeVQW16Tk52XwbS6ugj11fNDjJvoGeOJ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037