UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AcPiBJ998BmmvQrCynOjl97lfZ+HWnUcmgWojCjPF88='
WHERE
key_id = '62ac4afc01b85a759d5e8359d264f3228c2e7ae74bfe14942752f2361b494407'
AND (
token = 'AcPiBJ998BmmvQrCynOjl97lfZ+HWnUcmgWojCjPF88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)