UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zws6U5ucHeWVXIPZQ7d4wAhRzKdVT+cS+61Jn7HoEBQ='
WHERE
key_id = 'bc4f3fa77fad3bd5520cd197aeb3f8cfe7f786657ea65f1c3cce63262644a3bd'
AND (
token = 'Zws6U5ucHeWVXIPZQ7d4wAhRzKdVT+cS+61Jn7HoEBQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)