UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pzmB3QhzBo76L+lFcsPpsKf7EVKQNQNGdcrSdZSLo7Y='
WHERE
key_id = '20521851d91fe9ee56ed4fda8aef78f8a7a07c7affdbcde61e58f8c0f652bf47'
AND (
token = 'pzmB3QhzBo76L+lFcsPpsKf7EVKQNQNGdcrSdZSLo7Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)