UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X7s+2tlE9yEpJBFSxe6Yr4Frkb+xcpBJbe9lHVL7Tr8=' 
WHERE 
  key_id = 'bbd3b5bab972a2a03c68ae1fc7856292bcdfce616b2d219dfe69f6c90533ef8c' 
  AND (
    token = 'X7s+2tlE9yEpJBFSxe6Yr4Frkb+xcpBJbe9lHVL7Tr8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039