UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IPKeVwPL+i3cWCRfzTvMq2ZT55fOJDsLzFuh2RrT/Ls='
WHERE
key_id = '4c7b30ea77fc16209092261fb0ee5c891f291ae74aaf11080dbda6fcad1a6032'
AND (
token = 'IPKeVwPL+i3cWCRfzTvMq2ZT55fOJDsLzFuh2RrT/Ls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)