UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1569wEGo2lMXsGyuCe4Il2G/ThP45Avha+iVGdqZyXA=' 
WHERE 
  key_id = '4b43cb8fcc3213628673da0347e5c9210b93521eaf807c4fff7e1248b5da6936' 
  AND (
    token = '1569wEGo2lMXsGyuCe4Il2G/ThP45Avha+iVGdqZyXA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027