UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W5OWQ7xOfacr1b2F6j85xv6qXEyNaEqBOy5Qtkd/2QM='
WHERE
key_id = '7c7309e801fc41c58a562638040bf8045948166c086fafed8fb97c60b1fb4bfe'
AND (
token = 'W5OWQ7xOfacr1b2F6j85xv6qXEyNaEqBOy5Qtkd/2QM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)