UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1ZLEnj8UCtuNBIx60MkhkK1wRI0u195KnmqkXJQUGXE=' 
WHERE 
  key_id = '2ca61b83ec2eb2af1ac314ff8cd39a4b1fa5b8f4bd0d4986aa0d7384c10504bf' 
  AND (
    token = '1ZLEnj8UCtuNBIx60MkhkK1wRI0u195KnmqkXJQUGXE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025