UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r2hKV1C2bHXnrsWHkF2WFFROR/cJq3PnixlfOWCVzGw='
WHERE
key_id = '1344f58bf32d272a022f9fcaa601af2205ca7ec12f0cacfdade23fb9cc4d77a6'
AND (
token = 'r2hKV1C2bHXnrsWHkF2WFFROR/cJq3PnixlfOWCVzGw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)