UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CYaQr4xhJdc6pQIigZoILCyPVx/3vlh/e6SCdYu7ElU='
WHERE
key_id = '5803c3c6155475557d57af5aa873ea32f69611c96e5b5230dd9b309c7c0e9d33'
AND (
token = 'CYaQr4xhJdc6pQIigZoILCyPVx/3vlh/e6SCdYu7ElU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)