UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dBJP2x+8/na/5tfW5yOWxKPaRVFcSFY5y/Dymw4KIv0='
WHERE
key_id = '335cb29fa48a0de62f6ec5a3a6fcfc631fc38cbf5c89c5fe216a4584fb2c2f55'
AND (
token = 'dBJP2x+8/na/5tfW5yOWxKPaRVFcSFY5y/Dymw4KIv0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)