UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6x9KG9mwunT9jSxXdSSmMT7ClB9Tf1XjjeqVu2Hko+M='
WHERE
key_id = '2647e24dc0fa236376a241d430ae6b8958cbe24b8d4edad71bba054c9aba94ec'
AND (
token = '6x9KG9mwunT9jSxXdSSmMT7ClB9Tf1XjjeqVu2Hko+M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)