UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WpEtaWkST1yq908OHJaaqIZmyTMg/SIRD/2BE6kkXpc='
WHERE
key_id = '5ea22c02104ff5b20201cb56befe9346286ecc94858e16d3725f59579b00607f'
AND (
token = 'WpEtaWkST1yq908OHJaaqIZmyTMg/SIRD/2BE6kkXpc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)