UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V9eon5mowbSzZGGT5smlXGZt/ct8xYnfKrPUKW5ZQWM='
WHERE
key_id = 'c877b9348ef3088351f5f64f79d3c4a37274779c0153fef8aaaa1ff154ee6649'
AND (
token = 'V9eon5mowbSzZGGT5smlXGZt/ct8xYnfKrPUKW5ZQWM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)