UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wXy6Md65/DupPucEn4FYG7vavl5t6LEHO/4ybuGC1sU='
WHERE
key_id = '7a98bd39450d1af75b345284c61b5580086da9e52cff1a7add44b87323fb38f4'
AND (
token = 'wXy6Md65/DupPucEn4FYG7vavl5t6LEHO/4ybuGC1sU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)