UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sBrddt+Ky35s7EwhephbYyKWd10Zz6PR8x8ux6WBsV0='
WHERE
key_id = '201322da858dc004f42d6485ccb66d928569226f120bf6b971f0ae5e24721e78'
AND (
token = 'sBrddt+Ky35s7EwhephbYyKWd10Zz6PR8x8ux6WBsV0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)