UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AWek7mpQlHKApURGtGQoDZ9Vut4H+liOYkAd9DIIOmY='
WHERE
key_id = '522b86b5a9c94fe4038b8ef8abb21c6a0ea76ac32dc9a333d6fc889b5f784c44'
AND (
token = 'AWek7mpQlHKApURGtGQoDZ9Vut4H+liOYkAd9DIIOmY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)