UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4NFjflbfxu2OgFd6LHnvGq7GGot06o6bt6YJZKd6ISA='
WHERE
key_id = '4afc3cabb59ae2ba2eba6f5b144176ce7bdacab876c87bb6487a97fe8f77b17c'
AND (
token = '4NFjflbfxu2OgFd6LHnvGq7GGot06o6bt6YJZKd6ISA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)