UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OU7uz+l7JTvwUEmqey8ARiau+O5ySGj3hKVyIJDHdp0='
WHERE
key_id = 'c7e7c5b955e517a1c1d25193f1d2915b14166742949a80bc08da8dd85f9e266c'
AND (
token = 'OU7uz+l7JTvwUEmqey8ARiau+O5ySGj3hKVyIJDHdp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)