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