UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/EXrXvxpw3vsYGJvLXy8efkST70QyWnn9JmJyL9VKXI='
WHERE
key_id = 'f9166d0789139b7b1d37c13e6733e179d8ed1cfb9dfdd4308c29603ad4fe799e'
AND (
token = '/EXrXvxpw3vsYGJvLXy8efkST70QyWnn9JmJyL9VKXI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)