UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F1SHnj1vYA05VPpk5U8EnhUbTlFycpeY54cCHHZdpQc=' 
WHERE 
  key_id = '4f9acb057a0e74baacddce6bf29b996d8f0e10dbd609079a47e35668da4fd0d7' 
  AND (
    token = 'F1SHnj1vYA05VPpk5U8EnhUbTlFycpeY54cCHHZdpQc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038