UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mFkhKQdrHTDwpDPCaDQHCdibMcrh9O6qnbdHqZXBe7o=' 
WHERE 
  key_id = '7b63fc74056c4a7ff95fda4f87b24c35523d56328204cb8b2cae5b8ca2e37e9d' 
  AND (
    token = 'mFkhKQdrHTDwpDPCaDQHCdibMcrh9O6qnbdHqZXBe7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018