UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LiVdXrih4j8zJCWqU/sSfD7w7MSn7gUsSNpTzRJ2NLM=' 
WHERE 
  key_id = '6ea00c20cb2883cfea63c9146ca9dadc102e9901c3cffea1e3f252b43d1ba5c4' 
  AND (
    token = 'LiVdXrih4j8zJCWqU/sSfD7w7MSn7gUsSNpTzRJ2NLM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043