UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Y1MWFmV3ZOQdFFmFOKPrEDi89xfTPcrcO/XfuLZkTo='
WHERE
key_id = '7b140b5d1dd25b3df85db685e25712c10b9a89246cd0dea0205a49b6ea7da4f0'
AND (
token = '8Y1MWFmV3ZOQdFFmFOKPrEDi89xfTPcrcO/XfuLZkTo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)