UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QRVmGIOXfTVCuRikIk5y7XFsovL3H+kgxfOSVX7vMvs='
WHERE
key_id = 'ddfc00e10428989068fc76c6c5c5277bd1fe429b943a43e61950d47bb51d0930'
AND (
token = 'QRVmGIOXfTVCuRikIk5y7XFsovL3H+kgxfOSVX7vMvs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)