UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nLz1Hz1cloD1LxdZqYDuflX7Wf4B5bPNPGKsayZ0C/Q=' 
WHERE 
  key_id = '621497617fb672fc8345b555eabb579b6dedc2d317ab80ceb547ef4f8b62f3fd' 
  AND (
    token = 'nLz1Hz1cloD1LxdZqYDuflX7Wf4B5bPNPGKsayZ0C/Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037