UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OoRYax9uV0XReJSxfBmxHe6cjw/9/9Cn6V0I+fXcI4w='
WHERE
key_id = 'a60bbe370438eff0d64654a87f086ebe75298d5109684fa240287cda98f51c19'
AND (
token = 'OoRYax9uV0XReJSxfBmxHe6cjw/9/9Cn6V0I+fXcI4w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)