UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GJw8mwEm9PMO2CQfdkVz9JGqxGvk194J+sg0o9jSTis='
WHERE
key_id = '3b7853e4d64fa4f47a5bbc698c87054069fe972ce1d748780eb341d64f714a72'
AND (
token = 'GJw8mwEm9PMO2CQfdkVz9JGqxGvk194J+sg0o9jSTis='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)