UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/g1r5HHjGXRpOBhMc5X72nh+xrwhCvVxqBBDG5Tnnt4='
WHERE
key_id = '8639f2f6bb27c871f4b6c7282fe5e4a66e8586f40f073eb2e093abbbb46157f7'
AND (
token = '/g1r5HHjGXRpOBhMc5X72nh+xrwhCvVxqBBDG5Tnnt4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)