UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vr7VJ1/kzlu7uhIMqHHDv/EVNHFPuVhofs6tDCGlQgc='
WHERE
key_id = 'd630495e76ea0331a2871553cccdb2cc7f1a64a9635805e7762c0d94662efe8e'
AND (
token = 'vr7VJ1/kzlu7uhIMqHHDv/EVNHFPuVhofs6tDCGlQgc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)