UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BMoCdDMiC9Ag/2XuYGqWlGLd9KGe9M2ATMnTkSsNsvY='
WHERE
key_id = 'a81cc3f6d03d3f5f0e55f53bffe2c5af900bb7a6bd98c7e392ebca7b83c26a48'
AND (
token = 'BMoCdDMiC9Ag/2XuYGqWlGLd9KGe9M2ATMnTkSsNsvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)