UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7SAQ55fL9+CkLWw+x4AaPWD6/XQaCCwTTLgXEmACj48=' 
WHERE 
  key_id = '6cc7f838582d08336c1218937c520584aadcf3ce814a8e04ba489932da4ddb40' 
  AND (
    token = '7SAQ55fL9+CkLWw+x4AaPWD6/XQaCCwTTLgXEmACj48=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017