UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n4m+bEcSPnwkLmY6aJfzbKHWemp4n7vfJbTPIuCCRSY='
WHERE
key_id = 'c0ec2ba033587d108d6e27404e9ba74d424eef3b9587789fda8761b5adff768c'
AND (
token = 'n4m+bEcSPnwkLmY6aJfzbKHWemp4n7vfJbTPIuCCRSY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)