UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mv12au5uM7eaxrlnHP6XWlN5BGZ9jSRU4nHyXWCkx0U='
WHERE
key_id = '2e0ff56db5aab729b19ee3a8e43335e4716fbdd848ad23405e13d770a989e6af'
AND (
token = 'mv12au5uM7eaxrlnHP6XWlN5BGZ9jSRU4nHyXWCkx0U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)