UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '87FuNy1ztH2mDNgObrXZr8LAvPh74yfTxZ96XeO5qlo='
WHERE
key_id = '229150ea34d0eb72497ad78c29ed57ce73a18868c349783e813354816d3f89b7'
AND (
token = '87FuNy1ztH2mDNgObrXZr8LAvPh74yfTxZ96XeO5qlo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)