UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'elGgdNFO2D6/mhz0ejnuK9YSbPykN+lNAQn6jLB01Lo=' 
WHERE 
  key_id = '8065d75abc92750316836176f98a55027e372d41006d5c71ca8fbe9d7ba83b83' 
  AND (
    token = 'elGgdNFO2D6/mhz0ejnuK9YSbPykN+lNAQn6jLB01Lo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00077