UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6o5jRA0J4OCYZ2qEDfDbzl0tUPFQZv75DsPGsI0M+gk='
WHERE
key_id = 'f3425a667e07ae4480e345dff404b67ec27e1ac0f063aee71a14b31a126c7dcf'
AND (
token = '6o5jRA0J4OCYZ2qEDfDbzl0tUPFQZv75DsPGsI0M+gk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)