UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2J2jUN/abI1BLMymf7trwMGaFM41O/4N1R/ni4EMm38='
WHERE
key_id = '7e147767cae1c1f4a3b61906e346ba969348c05571cdf86e6f3a7a91b21dcd36'
AND (
token = '2J2jUN/abI1BLMymf7trwMGaFM41O/4N1R/ni4EMm38='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)