UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UNhyUN2zJTlq/Mf1gF7I+gauufK+fQLgaCW3VJnNrw8=' 
WHERE 
  key_id = '94121b2055fbf1b1cbb2f6ff7762f08304d35f257a1c1aea4dbf9117b35e21d2' 
  AND (
    token = 'UNhyUN2zJTlq/Mf1gF7I+gauufK+fQLgaCW3VJnNrw8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00069