UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ON0m+QLfaemlJNCZV/bO8ZivdC+POWmskQGnTkOv0EA='
WHERE
key_id = '8e6103dc5dc006ecfbd5a9717a2f95a82ac22b7fccf7537bbc4f4cae050b7998'
AND (
token = 'ON0m+QLfaemlJNCZV/bO8ZivdC+POWmskQGnTkOv0EA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)