UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jNwXhmRr9am6WOpgVc7tJHmyLZMjZFvNxoqc6Fjsszc=' 
WHERE 
  key_id = '5fad3d93e643ebd21efec31b6e12823c0af8003e69e6d77eed41f101d058289d' 
  AND (
    token = 'jNwXhmRr9am6WOpgVc7tJHmyLZMjZFvNxoqc6Fjsszc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039