UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zUVNcPbXoq3yi9fFjznRIU/vmktxdA3nv3ONbtpGkyg='
WHERE
key_id = '1a8a4bc874ca7f87b831dec5dbb63baadc938bde43df3abffecf9e697f7b6ced'
AND (
token = 'zUVNcPbXoq3yi9fFjznRIU/vmktxdA3nv3ONbtpGkyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)