UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CLTtUO5F+V76UaQyugaNumelvenFS3BAkVnuqQAIhmQ=' 
WHERE 
  key_id = '5333e8c570ad0d55dfe445fbdda530165affbecbc96bfb28f85a7f3b6bf3e038' 
  AND (
    token = 'CLTtUO5F+V76UaQyugaNumelvenFS3BAkVnuqQAIhmQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017